%{
#include<stdio.h>
#include<stdlib.h>
%}

%union{
	struct ast* a;
	double d;
	int v;
	char ch;
	struct symbol* s;

}


%start program

%right '='
%left '+' '-'
%left '*' '/' '%'
%nonassoc '`' UMINUS

%%

exp:	exp CMP exp
			|	exp '+' exp
			| exp '-' exp
			| exp '*' exp
			| exp '/' exp
			| exp '%' exp
			| '(' exp ')'
			| '-' exp %prec UMINUS
			|	NUMBER
			| NAME
			| NAME '=' exp
			| FUNC '(' paramslist ')'
			| FUNC '(' paramslist ')'



%%
